eventHandle = {}

function newEventHandler()
	local o = {}
	for k,v in pairs(eventHandle) do o[k]=v end
	o.events = {}
	return o
end

function eventHandle:AddEvent(eventName,eventFunc)
	table.insert(self.events,{event = eventName,func = eventFunc})
	return #self.events
end

function eventHandle:RemoveEvent(id)
	table.remvoe(self.events,id)
end

function eventHandle:CallEvent(eventName,...)
	for _,v in pairs (self.events) do
		if v.event == eventName then
			v.func(unpack(arg))
		end
	end
end
